package cn.jwtool.jwcache.buffer.config;

/**
 * @author : willian fu
 * @version : 1.0
 * 主要负责进行配置，以后跟spring兼容
 */
public class JwcatchConfig {

    /**
     * 是否开启事件监听器
     * 关闭则将不会传播事件
     */
    private static boolean listener = true;

    /**
     * 是否开启持久化
     * 注意：AOF持久化基于事件机制，若要使用此功能需要开启监听器
     */
    private static Boolean logOpen = true;

    //暂时只支持AOF
    private static String logType = "AOF";

    //缓存map初始化容量
    private static Integer INITIAL_CAPACITY = 100;

    //key自动过期扫描周期 ms
    public static Integer scanCycle = 0;

    private static String logPath = System.getProperty("user.dir");

    public static String getLogPath() {
        return logPath;
    }

    public static void setLogPath(String logPath) {
        JwcatchConfig.logPath = logPath;
    }

    public static boolean getListener() {
        return listener;
    }

    public static void setListener(boolean listener) {
        JwcatchConfig.listener = listener;
    }

    public static void setLogOpen(Boolean logOpen) {
        JwcatchConfig.logOpen = logOpen;
    }

    public static String getLogType() {
        return logType;
    }

    public static void setLogType(String logType) {
        JwcatchConfig.logType = logType;
    }

    public static Integer getInitialCapacity() {
        return INITIAL_CAPACITY;
    }

    public static void setInitialCapacity(Integer initialCapacity) {
        INITIAL_CAPACITY = initialCapacity;
    }

    public static boolean getLogOpen() {
        return logOpen;
    }



  /*  public synchronized static JwcatchConfig getInstance() {
        return Builder.INSTANCE;
    }

    private static final class Builder {
        private static final JwcatchConfig INSTANCE = new JwcatchConfig();
    }*/
}
